package org.jix.weblog.web.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.jix.weblog.module.common.domain.dos.BlogSettingsDO;
import org.jix.weblog.module.common.domain.mapper.BlogSettingsMapper;
import org.jix.weblog.module.common.utils.Response;
import org.jix.weblog.web.convert.BlogSettingsConvert;
import org.jix.weblog.web.model.vo.FindBlogSettingsDetailRspVO;
import org.jix.weblog.web.service.BlogSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @version 1.0
 * @Author Jix
 * @Date 2024/9/10 19:09
 * @注释
 */

@Service
@Slf4j
public class BlogSettingsServiceImpl implements BlogSettingsService {

    @Autowired
    private BlogSettingsMapper blogSettingsMapper;

    /**
     * 获取博客设置信息
     * @return
     */
    @Override
    public Response findDetail() {
        //查询博客设置信息
        BlogSettingsDO blogSettingsDO = blogSettingsMapper.selectById(1L);
        //DO转VO
        FindBlogSettingsDetailRspVO findBlogSettingsDetailRspVO = BlogSettingsConvert.INSTANCE.convertDO2VO(blogSettingsDO);

        return Response.success(findBlogSettingsDetailRspVO);
    }
}
